<%@ page language="java"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://acegisecurity.org/authz" prefix="authz"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib tagdir="/WEB-INF/tags" prefix="mytags"%>

<table cellspacing="0" width="100%">
	<tr class="light" height="20">
		<td width="25%"><span class="attribute">Make:</span></td>
		<td width="25%">${car.make.name}</td>
		<td width="25%"><span class="attribute">Model:</span></td>
		<td width="25%">${car.model}</td>
	</tr>
	<tr height="20">
		<td><span class="attribute">Year:</span></td>
		<td>${car.year}</td>
		<td><span class="attribute">KMs:</span></td>
		<td>${car.kms}</td>
	</tr>
	<tr class="light" height="20">
		<td><span class="attribute">Chassis ref:</span></td>
		<td>${car.chassisNumber}</td>
		<td><span class="attribute">Engine ref:</span></td>
		<td>${car.engineNumber}</td>
	</tr>
	<tr height="20">
		<td><span class="attribute">Color exterior:</span></td>
		<td>${car.colorExterior}</td>
		<td><span class="attribute">Interior:</span></td>
		<td>${car.interior}</td>
	</tr>
	<tr class="light" height="20">
		<td><span class="attribute">Drive:</span></td>
		<td>${car.drive}</td>
		<td><span class="attribute">Engine (cc):</span></td>
		<td>${car.cc}</td>
	</tr>
	<tr height="20">
		<td><span class="attribute">Price:</span></td>
		<td><c:choose>
			<c:when test="${not empty car.salesPrice}">
				<fmt:formatNumber value="${car.salesPrice}" pattern="#,##0.00" /> &euro;
            </c:when>
			<c:otherwise>
              ${car.alternativeTextPrice}
            </c:otherwise>
		</c:choose></td>
		<td><span class="attribute">Location:</span></td>
		<td>${car.location.name}</td>
	</tr>
	<tr class="light" height="20">
		<td><span class="attribute">Type:</span></td>
		<td>${car.type.name}</td>
		<td></td>
		<td></td>
	</tr>
</table>
<p>
<c:if test="${not empty car.options}">
<p><u><b>Options:</b></u>
<p>
<table cellspacing="1">
	<c:forEach items="${car.options}" var="option" varStatus="i">
		<c:if test="${i.count == 1 || i.count % 5 == 1}">
			<tr class="light">
		</c:if>
		<td width="150"><img src="<c:url value="/image/check_yes.gif" />" />${option.name}</td>
		<c:if test="${i.count % 5 == 0}">
			</tr>
		</c:if>
	</c:forEach>
</table>
</c:if>
<p><u><b>Description:</b></u>
<p>
<table>
	<tr>
		<td>${car.descriptionHtml}</td>
	</tr>
</table>
<p><u><b>Photos:</b></u>
<p>
<table>
	<c:forEach items="${car.images}" var="image" varStatus="i">
		<c:if test="${(i.count == 1) || (i.count % 5 == 1)}">
			<tr>
		</c:if>
		<td><a href="#"
			onclick="window.open('<c:url value="/viewCarImages.html" ><c:param name="id" value="${car.id}" /><c:param name="imageId" value="${image.id}" /></c:url>','Images')">
		<mytags:image id="${image.id}" cssClass="thumb" /> </a></td>
		<c:if test="${(i.count % 5 == 0) || (i.last)}">
			</tr>
		</c:if>
	</c:forEach>
</table>
<p>
<a href="<c:url value="/requestForm.html"><c:param name="car" value="${car.make.name} - ${car.model}" /></c:url>"><B>Interested? contact us</B></a>
